var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var TipsManager = require("AA_TipsManager");
var UIView = require("AA_UIView");
var CommonUtils = require("AA_CommonUtils");
var YunEdit = require("AA_YunEdit");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_FanKuiView = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.img = null;
    t.yunedit = null;
    t.btTu = null;
    t.xuanNode = [];
    return t;
  }
  __extends(_creator, e);
  _creator.prototype._show = function (e) {
    var t = [];
    for (var o = 1; o < arguments.length; o++) {
      t[o - 1] = arguments[o];
    }
    this.xuanNode.forEach(function (e) {
      e.children[0].children[0].active = true;
      e.children[0].children[1].active = false;
    });
    (window.wx || window.ks) && (this.btTu.active = false);
    if (cc.sys.isBrowser) {
      this.btTu.active = false;
      TipsManager.TipMgr.showToast("游览器暂不支持上传图片");
    }
  };
  _creator.prototype.onClickNode = function (e) {
    var t = e.getCurrentTarget();
    if (t.children[0].children[0].active) {
      t.children[0].children[0].active = false;
      t.children[0].children[1].active = true;
    } else {
      t.children[0].children[0].active = true;
      t.children[0].children[1].active = false;
    }
  };
  _creator.prototype.onClickTiJiao = function () {
    TipsManager.TipMgr.showToast("提交成功");
    this._close();
  };
  _creator.prototype.onCloseView = function () {
    this._close();
  };
  _creator.prototype.onClickTu = function () {
    var e = this;
    this.showTu(function (t) {
      e.img.spriteFrame = t;
      CommonUtils.default.LimitSpriteMaxSize(e.img, 250);
    });
  };
  _creator.prototype.showTu = function (e) {
    window.tt && window.tt.chooseImage({
      sourceType: ["album"],
      count: 1,
      success: function (t) {
        var o = t.tempFilePaths[0];
        var n = new Image();
        n.src = o;
        n.onload = function () {
          var t = new cc.Texture2D();
          t.initWithElement(n);
          t.handleLoadedTexture();
          e(new cc.SpriteFrame(t));
        };
      },
      fail: function () {
        console.log("chooseImage调用失败");
      }
    });
    (window.wx || window.ks) && (this.btTu.active = false);
    cc.sys.isBrowser && (this.btTu.active = false);
  };
  __decorate([_property(cc.Sprite)], _creator.prototype, "img", undefined);
  __decorate([_property(YunEdit.default)], _creator.prototype, "yunedit", undefined);
  __decorate([_property(cc.Node)], _creator.prototype, "btTu", undefined);
  __decorate([_property({
    type: cc.Node
  })], _creator.prototype, "xuanNode", undefined);
  return __decorate([_ccclass], _creator);
}(UIView.default);
exports.default = _def_FanKuiView;